for autoconf.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
#include "defs.h"
#include "cet.h"
#include "cet_util.h"
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
# include <expat.h>
#endif
*
*
*/
-
+#if HAVE_LIBEXPAT
int XMLCALL cet_lib_expat_UnknownEncodingHandler(void *data, const XML_Char *encoding, XML_Encoding *info)
{
cet_cs_vec_t *cs;
return XML_STATUS_OK;
}
+#endif
char *
int res, ct;
va_list args2; /* vsnprintf makes args unusable for a second try */
- va_copy(args2, args);
+ __va_copy(args2, args);
ct = vsnprintf(buff, sizeof(buff), fmt, args);
if (ct >= (int)sizeof(buff)) {
cout = xmalloc(ct + 1);
#include <ctype.h>
#include <stdio.h>
+#include "config.h"
#include "cet.h"
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
# include <expat.h>
#endif
#endif
#endif /* not defined XMLCALL */
+#if HAVE_LIBEXPAT
int XMLCALL cet_lib_expat_UnknownEncodingHandler(void *data, const XML_Char *encoding, XML_Encoding *info);
+#endif
/* helpers */
#include <string.h>
#include <stdarg.h>
#include <stddef.h>
+#include "config.h"
#include "queue.h"
#include "gbtypes.h"
#include "cet.h"
#define MYNAME "geo"
#define MY_CBUF 4096
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
static void
geo_rd_init(const char *fname)
{
#define MYNAME "google"
#define MY_CBUF 4096
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
static void
google_rd_init(const char *fname)
{
#include "xmlgeneric.h"
#include "cet_util.h"
#include "garmin_fs.h"
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
#include <expat.h>
static XML_Parser psr;
#endif
*s = 0;
}
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
static void
gpx_rd_init(const char *fname)
{
fatal(MYNAME ": This build excluded GPX support because expat was not installed.\n");
}
+static void
+gpx_rd_deinit(void)
+{
+}
+
#else /* NO_EXPAT */
static void
XML_SetCharacterDataHandler(psr, gpx_cdata);
fs_ptr = NULL;
}
-#endif
static
void
wpt_tmp = NULL;
cur_tag = NULL;
}
+#endif
static void
gpx_wr_init(const char *fname)
void
gpx_read(void)
{
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
int len;
int done = 0;
char *buf = xmalloc(MY_CBUF_SZ);
}
}
xfree(buf);
-#endif /* NO_EXPAT */
+#endif /* HAVE_LIBEXPAT */
}
static void
*/
#include "defs.h"
#include "cet_util.h"
-#if !NO_EXPAT
+#if HAVE_LIBEXPAT
#include <expat.h>
static XML_Parser psr;
#endif
#define FALSE 0
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
static void
hsa_ndv_rd_init(const char *fname)
{
#define MYNAME "kml"
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
static void
kml_rd_init(const char *fname)
{
*/
#include "defs.h"
#include "cet_util.h"
-#if !NO_EXPAT
+#if HAVE_LIBEXPAT
#include <expat.h>
static XML_Parser psr;
#endif
#define MYNAME "navicache"
#define MY_CBUF 4096
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
static void
nav_rd_init(const char *fname)
{
#define MYNAME "TourExchangeFormat"
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
void
tef_xml_rd_init(const char *fname)
{
#define MYNAME "wfff_xml"
#define MY_CBUF 4096
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
void
wfff_xml_rd_init(const char *fname)
{
#include "xmlgeneric.h"
#include "cet_util.h"
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
#include <expat.h>
static XML_Parser psr;
#endif
}
}
+#if HAVE_LIBEXPAT
static void
xml_cdata(void *dta, const XML_Char *s, int len)
{
}
xg_ignore_taglist = NULL;
}
+#else /* HAVE_LIBEXPAT */
+void
+xml_init(const char *fname, xg_tag_mapping *tbl, const char *encoding)
+{
+ fatal("This format does not support reading XML files as libexpat was not present.");
+}
+
+void xml_read(void)
+{
+}
+
+void xml_deinit(void)
+{
+}
+
+#endif /* HAVE_LIBEXPAT */
/******************************************/